//
//  MessageViewController.m
//  yemeishe1
//
//  Created by 吴坤金 on 2017/3/1.
//  Copyright © 2017年 yameishe. All rights reserved.
//

#import "MessageViewController.h"
#import "MessageTypeCell.h"
@interface MessageViewController ()<UITableViewDelegate,UITableViewDataSource>
{
    NSArray * _typeArray;
}
@property (nonatomic,weak) IBOutlet UITableView *tableView;
@end

@implementation MessageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self controllerSetting];
    
   
    _typeArray = [[NSArray alloc]initWithObjects:@"我的消息",@"系统通知消息",@"订单通知消息",@"互动答问",@"临时会话",@"收藏",@"黑名单", nil];
    _tableView.tableFooterView = [[UIView alloc]init];
    [_tableView registerNib:[UINib nibWithNibName:@"MessageTypeCell"bundle:nil] forCellReuseIdentifier:@"MessageTypeCell"];
    // Do any additional setup after loading the view from its nib.
}

-(void)viewWillDisappear:(BOOL)animated {
    // 反注册键盘
    [super viewWillDisappear:YES];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark -- UITableViewDataSource,UITableViewDelegate
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _typeArray.count;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    MessageTypeCell* cell = [tableView dequeueReusableCellWithIdentifier:@"MessageTypeCell"];
    [cell setTitle:_typeArray[indexPath.row]];
    return cell;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
